﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit.aspx.cs" Inherits="JumbotCms.WebFile.Admin._templatecontentliedit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>循环调用宏标记</title>
<link type="text/css" rel="stylesheet" href="../../admin/otherpage/styles/common.css" />
<script type="text/javascript" src="../../_data/SysConfig.js"></script>
<script type="text/javascript" src="../../_libs/jquery-min.js"></script>
<script type="text/javascript" src="../../scripts/jumbotcms.js?v4"></script>
<link type="text/css" rel="stylesheet" href="../../style/global.css" />
<link type="text/css" rel="stylesheet" href="../../_libs/jquery.formvalidator/style.css" />
<script type="text/javascript" src="../../_libs/jquery.formvalidator.js"></script>

<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({onError:function(msg){}});
	$("#txtCode").formValidator({tipid:"tipCode",onshow:"只能是数字和字母",onfocus:"字母区分大小写",oncorrect:""}).RegexValidator({regexp:"^[a-zA-Z0-9]+$",onerror:"只能是数字和字母"})
		.AjaxValidator({
		type : "get",
		data:		"id=<%=id%>",
		url:		"ajax.aspx?oper=checkname&time="+(new Date().getTime()),
		datatype : "json",
		success : function(d){	
			if(d.result == "1")
				return true;
			else
				return false;
		},
		buttons: $("#btnSave"),
		error: function(){alert("服务器没有返回数据，可能服务器忙，请重试");},
		onerror : "该代码名已经存在",
		onwait : "正在校验代码名的合法性，请稍候..."
	}).DefaultPassed();
	$("#txtTitle").formValidator({tipid:"tipTitle",onshow:"",onfocus:"请输入6-30个字符或3-15个汉字",oncorrect:""}).InputValidator({min:6,max:30,onerror:"请输入6-30个字符或3-15个汉字"});
	$("#txtTitleLen").formValidator({tipid:"tipTitleLen",onshow:"请填写数字",onfocus:"请填写数字",oncorrect:""}).RegexValidator({regexp:"^\([1-9]{1}[0-9]{0,2})$",onerror:"请填写数字"});
	$("#txtSummaryLen").formValidator({tipid:"tipSummaryLen",onshow:"请填写数字",onfocus:"请填写数字",oncorrect:""}).RegexValidator({regexp:"^\([1-9]{1}[0-9]{0,2})$",onerror:"请填写数字"});
	$("#txtDateFormat").formValidator({tipid:"tipDateFormat",onshow:"如yyyy-MM-dd，yyyy年MM月dd日，不对输入的格式作有效性校验",onfocus:"yyyy(年)MM(月)dd(日)HH(时)mm(分)ss(秒)",oncorrect:""}).InputValidator({min:3,onerror:"请输入日期格式"});
	$("#txtFields").formValidator({tipid:"tipFields",onshow:"如：[title],[summary]",onfocus:"每个字段用[]包含，并以,隔开",oncorrect:""}).RegexValidator({regexp:"^(\[[a-zA-Z0-9]+\])(,\[[a-zA-Z0-9]+\])*$",onerror:"格式有误"});
	$("#txtRepeat").formValidator({tipid:"tipRepeat",onshow:"标签全部使用小写，如:{$_title$}",onfocus:"只有被调用的字段标签才会生效",oncorrect:""}).InputValidator({min:8,onerror:"请输入内容"});
	$("#txtContent").formValidator({tipid:"tipContent",onshow:"其中$Repeat$标签为单记录循环内容",onfocus:"其中$Repeat$标签为单记录循环内容",oncorrect:""}).InputValidator({min:8,onerror:"请输入内容"});

});
    </script>
</head>
<body>
<form id="form1" runat="server" onsubmit="return jQuery.formValidator.PageIsValid('1')">
	<table class="formtable">
		<tr>
			<th> 标题 </th>
			<td><asp:TextBox ID="txtTitle" runat="server" MaxLength="20" Width="225px" CssClass="ipt"></asp:TextBox>
				<div class="ValidatorTip" id="tipTitle" style="width:250px"> </div></td>
		</tr>
		<tr>
			<th> 代码名 </th>
			<td> <asp:TextBox ID="txtCode" runat="server" Width="121px" CssClass="ipt"></asp:TextBox>
				<div class="ValidatorTip" id="tipCode" style="width:250px"> </div></td>
		</tr>
		<tr>
			<th> 标题最大输出字符 </th>
			<td><asp:TextBox ID="txtTitleLen" runat="server" Width="50px" CssClass="ipt">50</asp:TextBox>
				<div class="ValidatorTip" id="tipTitleLen" style="width:250px"> </div></td>
		</tr>
		<tr>
			<th> 简介最大输出字符 </th>
			<td><asp:TextBox ID="txtSummaryLen" runat="server" Width="50px" CssClass="ipt">100</asp:TextBox>
				<div class="ValidatorTip" id="tipSummaryLen" style="width:250px"> </div></td>
		</tr>
		<tr>
			<th> 时间格式 </th>
			<td><asp:TextBox ID="txtDateFormat" runat="server" Width="120px" CssClass="ipt">yy-MM-dd</asp:TextBox>
<div class="ValidatorTip" id="tipDateFormat" style="width:250px"> </div></td>
		</tr>
		<tr>
			<th> 调用字段 </th>
			<td><asp:TextBox ID="txtFields" runat="server" Width="100%" CssClass="ipt"></asp:TextBox>
<div class="ValidatorTip" id="tipFields" style="width:250px"> </div>
<br />id,channelid,classid三个字段不用填;选择img字段时必须选择isimg</td>
		</tr>
		<tr>
			<th> 只取带缩略图的内容 </th>
			<td><asp:RadioButtonList ID="rblIsImg" runat="server" EnableViewState="False" RepeatColumns="2">
					<asp:ListItem Selected="True" Value="0">否</asp:ListItem>
					<asp:ListItem Value="1">是</asp:ListItem>
				</asp:RadioButtonList>
			</td>
		</tr>
		<tr>
			<th> 只取被推荐的内容 </th>
			<td><asp:RadioButtonList ID="rblIsTop" runat="server" EnableViewState="False" RepeatColumns="2">
					<asp:ListItem Selected="True" Value="0">否</asp:ListItem>
					<asp:ListItem Value="1">是</asp:ListItem>
				</asp:RadioButtonList>
			</td>
		</tr>
		<tr>
			<th> 排序方式 </th>
			<td>
                <asp:DropDownList ID="ddlOrderBy" runat="server">
                <asp:ListItem Value="id">按录入时间</asp:ListItem>
                <asp:ListItem Value="viewnum">浏览次数</asp:ListItem>
                </asp:DropDownList>
			</td>
		</tr>
		<tr>
			<th>单记录循环模板  </th>
			<td><asp:TextBox ID="txtRepeat" runat="server" Height="60px" TextMode="MultiLine" Width="97%" CssClass="ipt"></asp:TextBox>
			<div class="ValidatorTip" id="tipRepeat" style="width:250px"> </div></td>
		</tr>
		<tr>
			<th> 全内容模板 </th>
			<td><asp:TextBox ID="txtContent" runat="server" Height="60px" TextMode="MultiLine" Width="97%">$Repeat$</asp:TextBox>
			<div class="ValidatorTip" id="tipContent" style="width:250px"> </div></td>
		</tr>
	</table>
	<div class="buttonok">
		<asp:Button ID="btnSave" runat="server" Text="确定" CssClass="btnsubmit" 
            onclick="btnSave_Click" />
		<input id="btnReset" type="button" value="取消" class="btncancel" OnClick="parent.JumbotCms.Popup.hide();" />
	</div>
</form>
<script>jcms$$SetDialogTitle();</script>
</body>
</html>
